package com.zytlifeservice.repository.find;

import com.zytlifeservice.domain.find.IntegralOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2017/6/1.
 */
@Repository
public interface IntegralOrderRepository extends JpaRepository<IntegralOrder, Long> {
    //查询用户订单
    @Query(value = "select c from IntegralOrder c where c.userId=?1 ")
    public List<IntegralOrder> findUserOrder(Long userId);

    public List<IntegralOrder> findAllByUserIdOrderByCreateDateDesc(long userId);

    @Query(value = "select u.commodity_id as ss from integral_order u",nativeQuery = true)
    public List<Object> findCustomDatas();

}
